﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sbook.Data;

namespace Sbook.Business
{
    public class UserService
    {
        private static UserController db = new UserController();
        #region[User_GetById]
        public static List<Data.UserInfo> User_GetById(string Id)
        {
            return db.User_GetById(Id);
        }
        #endregion
        #region[User_GetByTop]
        public static List<Data.UserInfo> User_GetByTop(string Top, string Where, string Order)
        {
            return db.User_GetByTop(Top, Where, Order);
        }
        #endregion
        #region[User_GetByAll]
        public static List<Data.UserInfo> User_GetByAll()
        {
            return db.User_GetByAll();
        }
        #endregion
        #region[User_Paging]
        public static List<Data.UserInfo> User_Paging(string CurentPage, string PageSize)
        {
            return db.User_Paging(CurentPage, PageSize);
        }
        #endregion
        #region[User_Insert]
        public static bool User_Insert(UserInfo data)
        {
            return db.User_Insert(data);
        }
        #endregion
        #region[User_Update]
        public static bool User_Update(UserInfo data)
        {
            return db.User_Update(data);
        }
        #endregion
        #region[User_Delete]
        public static bool User_Delete(string Id)
        {
            return db.User_Delete(Id);
        }
        #endregion
        #region[GEtByUserPAss]
        public static List<Data.UserInfo> User_GetByUserPass(string Username, string Pass)
        {
            return db.User_GetByUserPass(Username, Pass);
        }
        #endregion
        #region[isLogin]
        public static bool isLogin(string Username,string Pass)
        {
            if (db.User_GetByUserPass(Username,Pass).Count > 0)
                return true;
            return false;
        }
        #endregion
        #region[isAdmin]
        public static bool isAdmin(string Username, string Pass)
        {
            return db.isAdmin(Username, Pass);
        }
        #endregion

        #region[User_UpdateStatus]
        public static bool User_UpdateStatus(string UId,string Status)
        {
            return db.User_UpdateStatus(UId,Status);
        }
        #endregion
    }
}